package com.dpj.yygh.controller;


import com.dpj.yygh.common.result.Result;

import com.dpj.yygh.service.DepartmentService;
import com.dpj.yygh.vo.hosp.DepartmentVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(tags = "科室管理")
//@CrossOrigin
@RestController
@RequestMapping("/admin/hosp/department")
public class DepartmentController {

    @Autowired
    private DepartmentService departmentService;

    @ApiOperation("查询医院所有科室列表")
    @GetMapping("/getDepList/{hoscode}")
    public Result getDepList(@PathVariable String hoscode){
        List<DepartmentVo> list = departmentService.findDeptTree(hoscode);
        return Result.ok(list);

    }
}
